package com.task.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.task.common.entity.sys.Permission;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Huzz
 * @since 2021-10-11
 */
@Mapper
public interface PermissionMapper extends BaseMapper<Permission> {

    /**
     * 根据角色id列表查询所对应的权限
     * @param roleIds
     * @return
     */
    List<Permission> getLoginUserPermissionByRoleId(@Param("roleIds") Set<Integer> roleIds);

    /**
     * 根据请求路径查询对应的所有权限
     * @param requestUrl
     * @return
     */
    List<Permission> selectListByPath(@Param("requestUrl") String requestUrl);
}
